import request from '@/utils/request'

// 查询休假申请列表
export function listOaVacation(query) {
  return request({
    url: '/vacation/oaVacation/list',
    method: 'get',
    params: query
  })
}
// 查询休假申请列表
export function listNotLeave(query) {
  return request({
    url: '/vacation/oaVacation/list/not/leave',
    method: 'get',
    params: query
  })
}

// 查询休假申请详细
export function getOaVacation(id) {
  return request({
    url: '/vacation/oaVacation/' + id,
    method: 'get'
  })
}

// 保存休假申请
export function saveOaVacation(data) {
  return request({
    url: '/vacation/oaVacation/save',
    method: 'post',
    data: data
  })
}

// 删除休假申请
export function delOaVacation(id) {
  return request({
    url: '/vacation/oaVacation/' + id,
    method: 'delete'
  })
}

// 导出休假申请
export function exportOaVacation(query) {
  return request({
    url: '/vacation/oaVacation/export',
    method: 'get',
    params: query
  })
}

// 计算去除节假日和周末所剩余天数
export function countSurplusDay(date) {
  return request({
    url: '/vacation/oaVacation/countSurplusDay',
    method: 'get',
    params: date
  })
}

// 选择完休假类型获取剩余天数
export function vacationDay(params) {
 return request({
   url: '/vacation/oaVacation/vacationDay',
   method: 'get',
   params: { 'applicant': params.applicant, 'vacationType': params.vacationType, 'applicationTime': params.applicationTime }
 })
}

// 查询休假申请列表
export function vacationStatistics(query) {
  return request({
    url: '/vacation/oaVacation/statistics',
    method: 'get',
    params: query
  })
}
